from GuiObject import *

class GuiCbx(GuiObject):
	def __init__(self, x_, y_, text_, font_, fontSize_):
		GuiObject.__init__(self)
		self.text = text_
		self.font = pygame.font.Font(font_, fontSize_)
		textWH = self.font.size(self.text)
		self.x = x_
		self.y = y_
		self.w = textWH[0]
		self.h = textWH[1]
		self.checked = 0
	def draw(self):
		if self.checked:
			pygame.draw.rect(self.screen, (255,255,255), (self.getX()+2, self.getY()+2,10,10))
			pygame.draw.rect(self.screen, (25,25,25), (self.getX()+3, self.getY()+3,8,8))
		else:
			pygame.draw.rect(self.screen, (255,255,255), (self.getX()+2, self.getY()+2,10,10))
		textSurface = self.font.render(self.text, 1, (255,255,255))
		self.screen.blit(textSurface, ( self.getX() + 15, self.getY(), self.w, self.h))
